<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link type="text/css" rel="stylesheet" href="css/style.css" />
    <!--[if IE 6]>
    <script src="js/iepng.js" type="text/javascript"></script>
        <script type="text/javascript">
           EvPNG.fix('div, ul, img, li, input, a'); 
        </script>
    <![endif]-->
        
    <script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="js/menu.js"></script>    
	<script type="text/javascript" src="js/select.js"></script>
  <script src="./js/axios.js"></script>
  <script src="./js/vue.js"></script>
  <script src="./js/md5.js"></script>
    
<title>尤洪</title>
</head>
<body>  
  <div id="box">
<!--Begin Header Begin-->
<div class="soubg">
	<div class="sou">
    	<!--Begin 所在收货地区 Begin-->
    	<span class="s_city_b">
        	<span class="fl">送货至：</span>
            <span class="s_city">
            	<span>四川</span>
                <div class="s_city_bg">
                	<div class="s_city_t"></div>
                    <div class="s_city_c">
                    	<h2>请选择所在的收货地区</h2>
                        <table border="0" class="c_tab" style="width:235px; margin-top:10px;" cellspacing="0" cellpadding="0">
                          <tr>
                            <th>A</th>
                            <td class="c_h"><span>安徽</span><span>澳门</span></td>
                          </tr>
                          <tr>
                            <th>B</th>
                            <td class="c_h"><span>北京</span></td>
                          </tr>
                          <tr>
                            <th>C</th>
                            <td class="c_h"><span>重庆</span></td>
                          </tr>
                          <tr>
                            <th>F</th>
                            <td class="c_h"><span>福建</span></td>
                          </tr>
                          <tr>
                            <th>G</th>
                            <td class="c_h"><span>广东</span><span>广西</span><span>贵州</span><span>甘肃</span></td>
                          </tr>
                          <tr>
                            <th>H</th>
                            <td class="c_h"><span>河北</span><span>河南</span><span>黑龙江</span><span>海南</span><span>湖北</span><span>湖南</span></td>
                          </tr>
                          <tr>
                            <th>J</th>
                            <td class="c_h"><span>江苏</span><span>吉林</span><span>江西</span></td>
                          </tr>
                          <tr>
                            <th>L</th>
                            <td class="c_h"><span>辽宁</span></td>
                          </tr>
                          <tr>
                            <th>N</th>
                            <td class="c_h"><span>内蒙古</span><span>宁夏</span></td>
                          </tr>
                          <tr>
                            <th>Q</th>
                            <td class="c_h"><span>青海</span></td>
                          </tr>
                          <tr>
                            <th>S</th>
                            <td class="c_h"><span>上海</span><span>山东</span><span>山西</span><span class="c_check">四川</span><span>陕西</span></td>
                          </tr>
                          <tr>
                            <th>T</th>
                            <td class="c_h"><span>台湾</span><span>天津</span></td>
                          </tr>
                          <tr>
                            <th>X</th>
                            <td class="c_h"><span>西藏</span><span>香港</span><span>新疆</span></td>
                          </tr>
                          <tr>
                            <th>Y</th>
                            <td class="c_h"><span>云南</span></td>
                          </tr>
                          <tr>
                            <th>Z</th>
                            <td class="c_h"><span>浙江</span></td>
                          </tr>
                        </table>
                    </div>
                </div>
            </span>
        </span>
        <!--End 所在收货地区 End-->
        <span class="fr">
        	<span class="fl">你好，请<a href="Login.html">登录</a>&nbsp; <a href="Regist.html" style="color:#ff4e00;">免费注册</a>&nbsp;|&nbsp;<a href="#">我的订单</a>&nbsp;|</span>
        	<span class="ss">
            	<div class="ss_list">
                	<a href="#">收藏夹</a>
                    <div class="ss_list_bg">
                    	<div class="s_city_t"></div>
                        <div class="ss_list_c">
                        	<ul>
                            	<li><a href="#">我的收藏夹</a></li>
                                <li><a href="#">我的收藏夹</a></li>
                            </ul>
                        </div>
                    </div>     
                </div>
                <div class="ss_list">
                	<a href="#">客户服务</a>
                    <div class="ss_list_bg">
                    	<div class="s_city_t"></div>
                        <div class="ss_list_c">
                        	<ul>
                            	<li><a href="#">客户服务</a></li>
                                <li><a href="#">客户服务</a></li>
                                <li><a href="#">客户服务</a></li>
                            </ul>
                        </div>
                    </div>    
                </div>
                <div class="ss_list">
                	<a href="#">网站导航</a>
                    <div class="ss_list_bg">
                    	<div class="s_city_t"></div>
                        <div class="ss_list_c">
                        	<ul>
                            	<li><a href="#">网站导航</a></li>
                                <li><a href="#">网站导航</a></li>
                            </ul>
                        </div>
                    </div>    
                </div>
            </span>
            <span class="fl">|&nbsp;关注我们：</span>
            <span class="s_sh"><a href="#" class="sh1">新浪</a><a href="#" class="sh2">微信</a></span>
            <span class="fr">|&nbsp;<a href="#">手机版&nbsp;<img src="images/s_tel.png" align="absmiddle" /></a></span>
        </span>
    </div>
</div>
<div class="m_top_bg">
    <div class="top">
        <div class="m_logo"><a href="Index.html"><img src="images/logo1.png" /></a></div>
        <div class="m_search">
            <form>
                <input type="text" value="" class="m_ipt" />
                <input type="submit" value="搜索" class="m_btn" />
            </form>                      
            <span class="fl"><a href="#">咖啡</a><a href="#">iphone 6S</a><a href="#">新鲜美食</a><a href="#">蛋糕</a><a href="#">日用品</a><a href="#">连衣裙</a></span>
        </div>
        <div class="i_car">
            <div class="car_t">购物车 [ <span>3</span> ]</div>
            <div class="car_bg">
                <!--Begin 购物车未登录 Begin-->
                <div class="un_login">还未登录！<a href="Login.html" style="color:#ff4e00;">马上登录</a> 查看购物车！</div>
                <!--End 购物车未登录 End-->
                <!--Begin 购物车已登录 Begin-->
                <ul class="cars">
                    <li>
                        <div class="img"><a href="#"><img src="images/car1.jpg" width="58" height="58" /></a></div>
                        <div class="name"><a href="#">法颂浪漫梦境50ML 香水女士持久清新淡香 送2ML小样3只</a></div>
                        <div class="price"><font color="#ff4e00">￥399</font> X1</div>
                    </li>
                    <li>
                        <div class="img"><a href="#"><img src="images/car2.jpg" width="58" height="58" /></a></div>
                        <div class="name"><a href="#">香奈儿（Chanel）邂逅活力淡香水50ml</a></div>
                        <div class="price"><font color="#ff4e00">￥399</font> X1</div>
                    </li>
                    <li>
                        <div class="img"><a href="#"><img src="images/car2.jpg" width="58" height="58" /></a></div>
                        <div class="name"><a href="#">香奈儿（Chanel）邂逅活力淡香水50ml</a></div>
                        <div class="price"><font color="#ff4e00">￥399</font> X1</div>
                    </li>
                </ul>
                <div class="price_sum">共计&nbsp; <font color="#ff4e00">￥</font><span>1058</span></div>
                <div class="price_a"><a href="#">去购物车结算</a></div>
                <!--End 购物车已登录 End-->
            </div>
        </div>
    </div>
</div>
<!--End Header End--> 
<div class="i_bg bg_color">
    <!--Begin 用户中心 Begin -->
	<div class="m_content">
   		<div class="m_left">
        	<div class="left_n">管理中心</div>
            <div class="left_m">
            	<div class="left_m_t t_bg1">订单中心</div>
                <ul>
                	<li><a href="Member_Order.html">我的订单</a></li>
                    <li><a href="Member_Address.html">收货地址</a></li>
                    <li><a href="#">缺货登记</a></li>
                    <li><a href="#">跟踪订单</a></li>
                </ul>
            </div>
            <div class="left_m">
            	<div class="left_m_t t_bg2">会员中心</div>
                <ul>
                	<li><a href="Member_User.html" class="now">用户信息</a></li>
                    <li><a href="Member_Collect.html">我的收藏</a></li>
                    <li><a href="Member_Msg.html">我的留言</a></li>
                    <li><a href="Member_Links.html">推广链接</a></li>
                    <li><a href="#">我的评论</a></li>
                    <li v-show="isFlag" ><a href="./showUserList.html">用户列表</a></li>
                    <li><a href="Member_User_typeList.html">类型列表</a></li>
                </ul>
            </div>
            <div class="left_m">
            	<div class="left_m_t t_bg3">账户中心</div>
                <ul>
                	<li><a href="Member_Safe.html">账户安全</a></li>
                    <li><a href="Member_Packet.html">我的红包</a></li>
                    <li><a href="Member_Money.html">资金管理</a></li>
                </ul>
            </div>
            <div class="left_m">
            	<div class="left_m_t t_bg4">分销中心</div>
                <ul>
                	<li><a href="Member_Member.html">我的会员</a></li>
                    <li><a href="Member_Results.html">我的业绩</a></li>
                    <li><a href="Member_Commission.html">我的佣金</a></li>
                    <li><a href="Member_Cash.html">申请提现</a></li>
                </ul>
            </div>
        </div>
		<div class="m_right">
            <h1>分类列表</h1>
            <div id="app">
                分类类型&nbsp;<select v-model="type">
                <option value="0">全部</option>
                <option value="1">一级分类</option>
                <option value="2">二级分类</option>
                <option value="3">三级分类</option>
                <option></option>
            </select>
                &nbsp;&nbsp;&nbsp;
                分类名<input width="100px" v-model="name" />
                &nbsp;&nbsp;
                <button @click="chaXun()">查询</button>
                &nbsp;&nbsp;
                <button @click="add()">添加分类</button><br>
                <br />
                <table width="50%" >
                    <div v-for="item1 in typeList">
                        <tr>
                            <th>序号</th>
                            <th>分类名</th>
                            <th>分类类型</th>
                            <th>所属分类</th>
                            <th>操作</th>
                        </tr>
                        <tr v-for="(item,index) in typeList">
                            <td>{{index+1}}</td>
                            <td>{{item.name}}</td>
                            <td>
                                <span v-if="item.type==1">一级分类</span>
                                <span v-if="item.type==2">二级分类</span>
                                <span v-if="item.type==3">三级分类</span>
                            </td>
                            <td v-if="item.parentId==0">该分类为一级分类</td>
                            <td v-for="item1 in proType" v-if="item.parentId==item1.id">{{item1.name}}</td>
                            <td><a href="javascript:void(0);" @click="xg(item.id)">修改</a>
                                <a href="javascript:void(0);" @click="del(item.id)">删除</a>
                            </td>
                        </tr>
                </table>
                <span>共{{pageDate.count}}条</span>
                <div class="pages">
                    <a href="javascript:void(0);" class="p_pre" @click="onePage()">首页</a>
                    <a href="javascript:void(0);" class="p_pre" @click="shangPage()">上一页</a>
                    <a href="javascript:void(0);" class="p_pre" @click="xiaPage()">下一页</a>
                    <a href="javascript:void(0);" class="p_pre" @click="showLast()">末页</a>
                </div>
            </div>
               
            
        </div>
    </div>
	<!--End 用户中心 End--> 
    <!--Begin Footer Begin -->
    <div class="b_btm_bg b_btm_c">
        <div class="b_btm">
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
              <tr>
                <td width="72"><img src="images/b1.png" width="62" height="62" /></td>
                <td><h2>正品保障</h2>正品行货  放心购买</td>
              </tr>
            </table>
			<table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
              <tr>
                <td width="72"><img src="images/b2.png" width="62" height="62" /></td>
                <td><h2>满38包邮</h2>满38包邮 免运费</td>
              </tr>
            </table>
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
              <tr>
                <td width="72"><img src="images/b3.png" width="62" height="62" /></td>
                <td><h2>天天低价</h2>天天低价 畅选无忧</td>
              </tr>
            </table>
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
              <tr>
                <td width="72"><img src="images/b4.png" width="62" height="62" /></td>
                <td><h2>准时送达</h2>收货时间由你做主</td>
              </tr>
            </table>
        </div>
    </div>
    <div class="b_nav">
    	<dl>                                                                                            
        	<dt><a href="#">新手上路</a></dt>
            <dd><a href="#">售后流程</a></dd>
            <dd><a href="#">购物流程</a></dd>
            <dd><a href="#">订购方式</a></dd>
            <dd><a href="#">隐私声明</a></dd>
            <dd><a href="#">推荐分享说明</a></dd>
        </dl>
        <dl>
        	<dt><a href="#">配送与支付</a></dt>
            <dd><a href="#">货到付款区域</a></dd>
            <dd><a href="#">配送支付查询</a></dd>
            <dd><a href="#">支付方式说明</a></dd>
        </dl>
        <dl>
        	<dt><a href="#">会员中心</a></dt>
            <dd><a href="#">资金管理</a></dd>
            <dd><a href="#">我的收藏</a></dd>
            <dd><a href="#">我的订单</a></dd>
        </dl>
        <dl>
        	<dt><a href="#">服务保证</a></dt>
            <dd><a href="#">退换货原则</a></dd>
            <dd><a href="#">售后服务保证</a></dd>
            <dd><a href="#">产品质量保证</a></dd>
        </dl>
        <dl>
        	<dt><a href="#">联系我们</a></dt>
            <dd><a href="#">网站故障报告</a></dd>
            <dd><a href="#">购物咨询</a></dd>
            <dd><a href="#">投诉与建议</a></dd>
        </dl>
        <div class="b_tel_bg">
        	<a href="#" class="b_sh1">新浪微博</a>            
        	<a href="#" class="b_sh2">腾讯微博</a>
            <p>
            服务热线：<br />
            <span>400-123-4567</span>
            </p>
        </div>
        <div class="b_er">
            <div class="b_er_c"><img src="images/er.gif" width="118" height="118" /></div>
            <img src="images/ss.png" />
        </div>
    </div>    
    <div class="btmbg">
		<div class="btm">
        	备案/许可证编号：蜀ICP备12009302号-1-www.dingguagua.com   Copyright © 2015-2018 尤洪商城网 All Rights Reserved. 复制必究 , Technical Support: Dgg Group <br />
            <img src="images/b_1.gif" width="98" height="33" /><img src="images/b_2.gif" width="98" height="33" /><img src="images/b_3.gif" width="98" height="33" /><img src="images/b_4.gif" width="98" height="33" /><img src="images/b_5.gif" width="98" height="33" /><img src="images/b_6.gif" width="98" height="33" />
        </div>    	
    </div>
    <!--End Footer End -->    
</div>
</div>
  <script src="js/axios.js"></script>
  <script src="js/vue.js"></script>
  <script src="js/md5.js"></script>

  <script>
      var app = new Vue({
          el:"#app",
          data:{
              type:"",
              pageNo:1,
              name:"",
              pageDate:"",
              proType:[],
              typeList:[],
              pageCount:0,
          },
          methods:{
              md5Public:async function(objectStr){
                  let randomNum = 0;
                  //接口拿随机数
                  await axios({
                      url:"http://localhost:8080/setRedisNum",
                      methods:"get"
                  }).then(res => {
                      // alert("随机数开始");
                      console.log("随机数:"+res.data);
                      randomNum = res.data;

                  })
                  //放到header里的参数 时间戳 随机数 加密的字符串
                  //时间戳
                  var dateStr = new Date();
                  dateStr = Date.now();

                  //把obj按照key值升序
                  let sortObject = function(obj){
                      let sorter = function(a,b){
                          return obj[a] - obj[b];
                      }
                      let keys = Object.keys(obj);
                      keys.sort(sorter);
                      let res = {};
                      keys.forEach(key => {
                          res[key] = obj[key];
                      });
                      return res;
                  }
                  //升序的对象
                  var sxStr = sortObject(objectStr);
                  //把升序的对象转成字符串
                  var jsonStr = "";
                  for(let obj in objectStr){
                      jsonStr += obj+"="+objectStr[obj]+"&";
                  }
                  //把最后一个&符号切割了
                  jsonStr = jsonStr.substr(0, jsonStr.length - 1);

                  //加密字符串
                  var str = MD5(jsonStr+randomNum);
                  console.log("jsonStr:"+jsonStr);
                  console.log("randomNum:"+randomNum);
                  // alert("str:"+str);
                  await axios({
                      url:"http://localhost:8080/returnInterfaceStr",
                      methods:"POST",
                      params:objectStr,
                      headers:{
                          "TimeStamp":dateStr,
                          "randomNum":randomNum,
                          "encryptionStr":str
                      }
                  }).then(res => {
                      console.log(res);
                      console.log("后端接受之:"+res.data);
                      if( res.data == true ){
                          return true;
                      }else{
                          return false;
                      }
                  })
                  return true;
              },
              showProductTypeByPage:async function(pageNo){
                  var that = this;
                  let flag = await this.md5Public({"a1":54,"a2":55,"a3":56});
                  if( flag == true ){
                      await axios({
                          method:'post',
                          url:"http://localhost:8080/showProductTypeByPage",
                          headers: { 'content-type': 'application/x-www-form-urlencoded' },
                          data: {
                              type:that.type,
                              pageNo:that.pageNo,
                              name:that.name,
                          }
                      }).then(function (response) {
                          that.pageDate=response.data.data;
                          console.log(that.pageDate);
                          that.typeList=response.data.data.list;
                          console.log(that.pageDate.list);
                          that.count=response.data.data.count;
                          that.pageCount=response.data.data.pageCount;

                      })
                  }
              },
              xg:function (id) {
                  window.location="Member_User_typeUpdate.html?id="+id;
              },
              showProTypeId1:async function (){
                  // alert(2)
                  var that = this;
                  let flag = await this.md5Public({"a1":54,"a2":55,"a3":56});
                  if( flag == true ){
                      await axios ({
                          method: 'post',
                          url:"http://localhost:8080/getProductTypes",
                          headers: { 'content-type': 'application/x-www-form-urlencoded' },
                          data:{
                              // typeId:1,
                          }
                      }).then(function (response) {
                          console.log(response.data.data)
                          that.proType=response.data.data;
                          // console.log(that.proType1);
                      })
                  }
              },
              chaXun:function () {
                  this.showProductTypeByPage(1);
              },
              add:function () {
                  window.location.href="Member_User_typeAdd.html";
              },
              onePage: function() {
                  this.pageNo = 1;
                  this.showProductTypeByPage(this.pageNo);
              },
              shangPage: function() {
                  var pageNo1 = this.pageNo - 1
                  if (pageNo1 > 0) {
                      this.showProductTypeByPage(pageNo1);
                      this.pageNo = pageNo1;
                  } else {
                      alert("当前页面为第一页")
                  }
              },

              xiaPage: function() {
                  var pageNo1 = this.pageNo + 1
                  if (pageNo1 <= this.pageCount) {
                      this.showProductTypeByPage(pageNo1);
                      this.pageNo = pageNo1;
                  } else {
                      alert("当前页面为最后一页");
                  }
              },

              showLast: function() {
                  this.showProductTypeByPage(this.pageCount);
                  this.pageNo = this.pageCount;
              },
              del:async function(id){
                  if(confirm("是否删除？")){
                      var that = this;
                      let flag = await this.md5Public({"a1":54,"a2":55,"a3":56});
                      if( flag == true ){
                          await axios ({
                              method: 'post',
                              url:"http://localhost:8080/delProductType",
                              headers: { 'content-type': 'application/x-www-form-urlencoded' },
                              data:{
                                  id:id,
                              }
                          }).then(function (response) {
                              console.log(response.data.data);
                              if(response.data.data>0){
                                  alert("删除成功！");
                                  that.showProductTypeByPage(1);
                              }else {
                                  alert("此标签下还有内容无法删除！")
                              }
                          })
                      }
                  }

              },
          },

          created(){
              this.showProductTypeByPage(1);
              this.showProTypeId1();
          }
      })


  </script>
</body>


<!--[if IE 6]>
<script src="//letskillie6.googlecode.com/svn/trunk/2/zh_CN.js"></script>
<![endif]-->
</html>
